function toggleBorder(img) {
  if(!img.style.border||img.style.borderLeftStyle=='none') {
    img.style.border = "1px solid red";
  } else {
    img.style.border = "none";
  }
}


function toggleBorder(img,oldTool) {
	
	switch (oldTool){
	case 0:
		toggleBorder(document.getElementById("imgText"));
		break;
	case 1:
		toggleBorder(document.getElementById("imgComment"));
	break;
	case 2:
		toggleBorder(document.getElementById("imgRadio"));
	break;
	case 3:
		toggleBorder(document.getElementById("imgCheckbox"));
	break;
	case 4:
		toggleBorder(document.getElementById("imgFile"));
	break;
	case 5:
		toggleBorder(document.getElementById("imgDate"));
	break;
	}
  if(!img.style.border||img.style.borderLeftStyle=='none') {
    img.style.border = "2px solid black";
  } else {
    img.style.border = "none";
  }
}
